1. Field of the Invention
The instant disclosure relates to a decoding method and a decoder used therein; in particular, to a BCH decoding method and a decoder used therein.
2. Description of Related Art
In recent years, the wireless communication has well-developed, so that it dramatically increases the convenience of data transmission. However, there might be errors or distortion during the data transmission because of the noise interference or the reliability of the transmission media. The error control coding is used to recover the data having distortion. The often-used error control coding are Hamming Code, Reed Solomon Code, Bose Chaudhuri Hocquengham (BCH) Code, Low Density Parity Check Code (LDPC Code), etc. BCH code is one error control coding that is widely used in the storing device and the communication device, so as to assure the reliability and accuracy of the data.
The BCH encoding and the BCH decoding can both be implemented via a frame of the Linear Feedback Shift Register. However, compared with the BCH encoding, the BCH decoding is a more complex process. In details, please refer to FIG. 1, FIG. 1 shows a flow chart of a traditional BCH decoding method. The step S101 is to receive the encode data. The step S102 is to calculate the syndrome by the received encode data. The step S103 is to calculate the Error Location Polynomial via the syndrome. The step S104 is to calculate the error location via the error location polynomial. Finally, the step S105 is to perform the error correction according to the error location.
It is worth mentioning that, it might cost lots of time to calculate the error location via the error location polynomial. Therefore, compared with the BCH decoding method shown in FIG. 1, there is another BCH decoding method that can reduce the time consumption of the BCH decoding process. In details, please refer to FIG. 2, FIG. 2 shows a flow chart of another traditional BCH decoding method. The step S201 is to receive the encode data. The step S202 is to calculate the syndrome via the received encode data. The step S203 is to determine whether the syndrome is satisfied with the null vector. In other words, if the encode data with noise interference times the check matrix and the products are all zeroes (which means that the syndrome is satisfied with the null vector), and this encode data is an effective encode data and it enters into the step S208. If the syndrome is not satisfied with the null vector, it enters into the step S204. The step S204 is to calculate the error location polynomial via the syndrome. The step S205 is to calculate the error location via the error location polynomial. The step S206 is to determine whether the error correction is allowed. If the number of bits having errors in the encode data can still be handled by the error correction, it enters into the step S207. If the number of bits having errors in the encode data can't be handled by the error correction, it enters into the step S208. The step S207 is to perform the error correction according to the error location. The step S208 is to end the BCH decoding.
In other words, the traditional BCH decoding method shown in FIG. 2 is to determine whether to continue the BCH decoding process according to whether the syndrome is satisfied with the null vector. If the syndrome is satisfied with the null vector, the BCH decoder determines that the decoding for the encode data is successful, and outputs the BCH decode data. In other words, if the syndrome is satisfied with the null vector, the BCH decode would not execute the operation in the steps S204˜S207, so as to reduce the time consumption of decoding.
From the above, the traditional BCH decoding method shown in FIG. 2 can reduce the time consumption of BCH decoding, but in the traditional BCH decoding method, the determination for whether the encode data can be successfully decoded should still be made after calculating the error location, such as the step S206. That is, if the encode data can't be successfully decoded, the time cost of operating for the encode data would become a waste, which thus decreases the throughput of decoding. Therefore, a BCH decoding method and the decode using the same are needed for both increasing the throughput of decoding and reducing the time consumption of decoding.